#include "child.h"

child::child()
{

    setWindowTitle("基站信息");
    this->resize(650,400);
    QVBoxLayout *vbox =new QVBoxLayout;
    tu = new MainWindow;
    QHBoxLayout *hbox1 =new QHBoxLayout;
    hbox1->addWidget(tu);


//    wen_diary =new QPushButton("温度日志");
//    hbox2->addWidget(wen_diary);
    QHBoxLayout *hbox2 =new QHBoxLayout;
    QFormLayout *form1 =new QFormLayout;
    wendu = new QLineEdit;
    wendu->setText("28");
    wendu->setReadOnly(true);
    form1->addRow("室内温度",wendu);
    hbox2->addLayout(form1);
    QFormLayout *form2 =new QFormLayout;
    shidu = new QLineEdit;
    shidu->setText("75%");
    shidu->setReadOnly(true);
    form2->addRow("室内湿度",shidu);
    hbox2->addLayout(form2);
    vbox->addLayout(hbox2,1);

    vbox->addLayout(hbox1,8);
    this->setLayout(vbox);
//    connect(wen_diary,&QPushButton::clicked,this,&child::opentu);
}

void child::setvalue(QString value)
{
qDebug() << "valu";
    int a = value.toInt();

    wendu->setText(value);
    tu->adddata(a);

 //   update();
}

void child::setvalue2(QString value2)
{

    int b = value2.toInt();
    qDebug() << value2.toInt();
    tu->adddata2(b);
    qDebug () << "456";
 //   update();
}

void child::setvalue3(QString value3)
{

    int c = value3.toInt();
    qDebug() << value3.toInt();
    shidu->setText(value3 + "%");
    tu->adddata3(c);
    qDebug () << "456";
 //   update();
}

